2020-2021 Sunseeker Telemetry and Lighting System
adc12_a_ex4_repeatedSeq.c File Reference
#include "driverlib.h"

Go to the source code of this file.

Macros

#define Num_of_Results   8
 

Functions

void main (void)
 
void ADC12ISR (void)
 

Variables

volatile uint16_t A0results [Num_of_Results]
 
volatile uint16_t A1results [Num_of_Results]
 
volatile uint16_t A2results [Num_of_Results]
 
volatile uint16_t A3results [Num_of_Results]
 

Macro Definition Documentation

◆ Num_of_Results

#define Num_of_Results   8

ADC12_A - Sample A0-3 Input, AVcc Ref, Repeated Sequence of Conversions

This example shows how to perform a repeated sequence of conversions using "repeat sequence-of-channels" mode. AVcc is used for the reference and repeated sequence of conversions is performed on Channels A0, A1, A2, and A3. Each conversion result is stored in ADC12MEM0, ADC12MEM1, ADC12MEM2, and ADC12MEM3 respectively. After each sequence, the 4 conversion results are moved to A0results[], A1results[], A2results[], and A3results[]. Test by applying voltages to channels A0 - A3. Open a watch window in debugger and view the results. Set Breakpoint1 in the index increment line to see the array values change sequentially and Breakpoint2 to see the entire array of conversion results in A0results[], A1results[], A2results[], and A3results[]for the specified Num_of_Results.

Note that a sequence has no restrictions on which channels are converted. For example, a valid sequence could be A0, A3, A2, A4, A2, A1, A0, and A7. See the MSP430x5xx User's Guide for instructions on using the ADC12_A.

          MSP430F552x
       -----------------
   /|\|                 |
    | |          P6.0/A0|<- Vin0
    --|RST       P6.1/A1|<- Vin1
      |          P6.2/A2|<- Vin2
      |          P6.3/A3|<- Vin3
      |                 |Vref is Vcc in all cases

This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:

  • ADC12_A peripheral
  • GPIO Port peripheral
  • A0
  • A1
  • A2
  • A3

This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.

  • ADC12_A_VECTOR

Definition at line 79 of file adc12_a_ex4_repeatedSeq.c.

Function Documentation

◆ ADC12ISR()

void ADC12ISR ( void  )

Definition at line 216 of file adc12_a_ex4_repeatedSeq.c.

◆ main()

void main ( void  )

Definition at line 86 of file adc12_a_ex4_repeatedSeq.c.

References __no_operation().

Variable Documentation

◆ A0results

volatile uint16_t A0results[Num_of_Results]

Definition at line 81 of file adc12_a_ex4_repeatedSeq.c.

◆ A1results

volatile uint16_t A1results[Num_of_Results]

Definition at line 82 of file adc12_a_ex4_repeatedSeq.c.

◆ A2results

volatile uint16_t A2results[Num_of_Results]

Definition at line 83 of file adc12_a_ex4_repeatedSeq.c.

◆ A3results

volatile uint16_t A3results[Num_of_Results]

Definition at line 84 of file adc12_a_ex4_repeatedSeq.c.